<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%
	String name = new String(request.getParameter("name").getBytes("ISO-8859-1"), "UTF-8");
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="viewport" id="viewport"
	content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no" />
<link href="./css/reset.css" rel="stylesheet" type="text/css">
<link href="./css/index.css" rel="stylesheet" type="text/css">
<link href="./css/discounts.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
</head>
<body>
	<div class="near-box">
		<!--头部开始-->
		<div class="header">
			<a href="javascript:history.back()" class="left"></a>
			<p class="headerText"></p>
		</div>
		
		<!--头部结束-->
		<div class="discounts-bigbox">
			<div class="discounts-banner1 mt-10">
				<img  src="<%=request.getParameter("photo")%>">
			</div>
			<!-- <div class="discounts-banner1 mt-10"><img src="./images/coupon.jpg" alt=""></div> -->
			<div class="special-sale-box3 border-top">
				
			</div>

		</div>
	</div>
	<script type="text/javascript" src="js/scrolltopcontrol.js"></script>
	<script type="text/javascript">
	$(".headerText").html(decodeURI(GetQueryString("name")));
		$(function(){
					var cid="<%=request.getParameter("cId")%>";
					var path="<%=request.getSession().getAttribute("path")%>";
					$.post("../../../tszs/txr/titleShow2.do?CParentlevelidEqualTo="+cid,function(data){
				if(data.type==1){
					var html="";
					var img="";
					if(data.data.length < 4){
						for (var i = 0; i < data.data.length; i++) {
							html+="<ul class=\"goodUlBox\"><a href=\"javascript:findShopDatails('"+data.data[i].cId+"')\">"+
							"<li class=\"goodsImg\"><img src='/file/"+data.data[i].cPhtoto.split(",")[0]+"'><i class=\"goodsImg2\"></i></li>"+
							"<li class=\"goodsName\">"+data.data[i].cName+"</li>"+
							"<li class=\"goodsPrice\">￥"+data.data[i].cPrice+"</li>"+
							"<li class=\"goodsButton\">查看详情</li>"+
							"</a></ul>";		
						}
					}
					else{
						for (var i = 0; i < data.data.length; i++) {
							html+="<ul class=\"special-sale-box4 border-bottom\"><a href=\"javascript:findShopDatails('"+data.data[i].cId+"')\">"+
							"<li class=\"special-sale-img1\"><img src='/file/"+data.data[i].cPhtoto.split(",")[0]+"'><i class=\"d-box1-img2\"></i></li>"+
							"<li class=\"special-sale-tbox\">"+data.data[i].cName+"</li>"+
							"<li class=\"special-sale-text2\">"+data.data[i].cPrice+"￥</li>"+
							"</a></ul>";		
						}
					}
					
				$(".border-top").html(html);
				}else{
					$(".border-top").html("暂无更多数据！");
					$(".border-top").css("text-align", "center");
				}

			},"json")
		})
		
		function findShopDatails(cid){
	 		window.location.href="goods-details.jsp?cid="+cid;
		}
		
		function GetQueryString(name){
		     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
		     var r = window.location.search.substr(1).match(reg);
		     if(r!=null)
		        return  decodeURI(r[2]);
		      return null;
		}
	</script>
</body>
